package com.leen.entity;

import com.leen.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author 
 * 角色信息表
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "sys_role")
@ApiModel(value = "角色模型")
public class Role  extends BaseEntity implements Serializable {
    /**
     * 角色ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "role_id")
    private Integer roleId;


    @Column(name = "role_name")
    @ApiModelProperty(value = "角色名称")
    @NotBlank(message = "角色名称不能空")
    private String roleName;

    /**
     * 角色权限字符串
     */
    @Column(name  = "role_key")
    @ApiModelProperty(value = "角色权限字符")
    @NotBlank(message = "角色权限字符不能空")
    private String roleKey;

    /**
     * 角色状态（0正常 1停用）
     */
    @ApiModelProperty(value = "状态 0正常 1停用",example = "0")
    @Column(name  = "status")
    @NotNull(message = "角色状态不能空")
    private Integer status;


    private static final long serialVersionUID = 1L;
}